use std::sync::Arc;

use async_trait::async_trait;

use crate::airport::airport::Airport;

use super::XID;

#[async_trait]
pub trait ProtocolHandler: Send + Sync {
    /**
     * 发送消息
     */
    fn send_msg(&self, data: Vec<u8>);
    /**
     * 处理消息
     */
    async fn handle_msg(&self, airport:&Airport, channel_id: i64, data: Vec<u8>) -> bool;

    /**
     *  获取id
     */
    fn get_xid(&self, data: &Vec<u8>) -> XID;

    fn get_version(&self) -> u16;

}
